|
|
|
|
|
|
|
Figure 14.19.
The new error object library in action. |
|
|
|
|
|
|
|
|
Listing 14.24. Creating a divide-by-zero error in code. |
|
|
|
|
|
|
|
|
Private Sub Command1_Click()
'
On Error GoTo Localerr
Dim rtn as Long
'
Print 6 / 0
'
Exit Sub
'
Localerr:
rtn = objErr.errHandler(Err, erritem, errresume, "prjTest.
Form1.Command1_Click")
Resume Next
'
End Sub |
|
|
|
|
|
|
|
|
When you save and run this code, press the command button to see the new error report. You should see that the Help button is active. Press the Help button to display Visual Basic 5 help for dealing with the divide-by-zero error (see Figure 14.20). |
|
|
|
|
| |
|
|
|
|
Check out Appendix B for information on how you can create your own help files for your Visual Basic 5 projects. |
|
|
|
|
|
|
|